package 终极案例;

//6个评委打分 去掉最低分 求平均值；

import java.util.Scanner;

public class test {
    public static void main(String[] args) {
        int[] arr = new int[6];
        Scanner sc = new Scanner(System.in);
        for (int i = 0; i < arr.length; i++) {
            System.out.println("请输入成绩");
            int a = sc.nextInt();
            arr[i] = a;
        }
        System.out.print("[");
        for (int i = 0; i < arr.length; i++) {
            if (i == arr.length - 1) {
                System.out.print(arr[i]);
            } else {
                System.out.print(arr[i] + ",");
            }
        }
        System.out.println("]");
        int min = arr[0];
        for (int i = 1; i < arr.length; i++) {
            if (min > arr[i]) {
                min = arr[i];
            }
        }
        int sum = 0;
        for (int i1 = 0; i1 < arr.length; i1++) {
            sum += arr[i1];
        }
        double avg =1.0F * (sum - min) / (arr.length-1);
        System.out.println("平均成绩为" + avg);
    }
}
